package 多线程;

/**
 * Created By  醉美柳舞之众星捧月
 *
 * @author song
 * @date 2017/11/10 22:50
 */
public class Notifier implements Runnable {
    /**
     * Author song  醉美柳舞之众星捧月
     * Date & Time  2017/11/10 22:50
     * Description   唤醒类
     */

    private Message message;

    public Notifier(Message message) {
        this.message = message;
    }

    @Override
    public void run() {
        String name = Thread.currentThread().getName();
        synchronized (message) {
            message.setMsg("唤醒线程工资");
//            message.notify();
            message.notifyAll();
            //上面是唤醒单个  ,   下面这个是唤醒全部
        }
    }
}
